package top.eggcode.component.query.predicate;

import top.eggcode.component.query.model.Expression;

import java.util.List;

/**
 * Title: 谓语
 * Description: TODO
 * Date: 2021/9/14 9:27
 *
 * @author JiaQi Ding
 * @version 1.0
 */
public interface Predicate extends Expression<Boolean> {

    /**
     * 获取连接操作符
     *
     * @return 连接类型
     */
    Predicate.LinkOperator getOperator();


    /**
     * 否定谓词，通过 not
     *
     * @return 布尔值，指示谓词是否为否定谓词
     */
    boolean isNegated();


    List<Expression<Boolean>> getExpressions();

    /**
     * Create a negation of the predicate.
     *
     * @return negated predicate
     */
    Predicate not();

    public static enum LinkOperator {
        AND,
        OR;

        private LinkOperator() {
        }
    }

}
